package joonany.basic;

import java.util.Scanner;

public class Charge {

	public static void main(String[] args) {
		
		int sip, oSip, back, oBack, cheon, oCheon, man, oMan, won, charge, inPut;
		
		//charge = 876543210 ; JDK7, 자릿수 구분 : _
		charge = 8_7654_3210 ;

		inPut = charge;
		
		oMan = inPut / 50000;	inPut %= 50000;  
		man = inPut / 10000;	inPut %= 10000;
		oCheon = inPut / 5000;	inPut %= 5000;
		cheon = inPut / 1000;	inPut %= 1000;
		oBack = inPut / 500;	inPut %= 500;
		back = inPut / 100;		inPut %= 100;
		oSip = inPut / 50;		inPut %= 50;
		sip = inPut / 10;		inPut %= 10;
		won = inPut;
		
		System.out.println("잔돈" + charge + "원은");
		System.out.println("50000원" + oMan + "장");
		System.out.println("10000원" + man + "장");
		System.out.println("5000원" + oCheon + "장");
		System.out.println("1000원" + cheon + "장");
		System.out.println("500원" + oBack + "개");
		System.out.println("100원" + back + "개");
		System.out.println("50원" + oSip + "개");
		System.out.println("10원" + sip +"개");
		System.out.println("1원" + won +"개");
			}

}
